{include file='public:header-css'/}
<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        {include file='public:left-menu'/}
        <!--End 左侧导航-->
        <!--头部信息-->
        {include file='public:nav-header' title="系统管理" subTitle="系统设置"/}
        <!--End 头部信息-->

        <!--页面主要内容-->
        <main class="lyear-layout-content">

            <div class="container-fluid">

                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <ul class="nav nav-tabs page-tabs">
                                {volist name="$group_list" id="group"}
                                <li class="{$key==$inc_type ?'active':''}"><a href="{:url('System/index',['inc_type'=>$key])}">{$group}</a></li>
                                {/volist}
                            </ul>
                            <div class="tab-content">
                                <div class="tab-pane active">
                                    <form action="#!" method="post" class="edit-form">
                                        <div class="form-group">
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <label for="auto_qx_time">自动取消订单</label>
                                                    <div class="input-group">
                                                        <input class="form-control" type="text" id="auto_qx_time" name="auto_qx_time"
                                                               value="{$config.auto_qx_time}" placeholder="请输入时间">
                                                        <span class="input-group-addon">分钟</span>
                                                    </div>
                                                    <span class="help">待付款订单多少时间内未付款，系统自动取消订单 单位为分钟</span>
                                                </div>
                                                <div class="col-md-6">
                                                    <label for="auto_qr_time">自动确认收货</label>
                                                    <div class="input-group">
                                                        <input class="form-control" type="text" id="auto_qr_time" name="auto_qr_time"
                                                               value="{$config.auto_qr_time}" placeholder="请输入时间">
                                                        <span class="input-group-addon">天</span>
                                                    </div>
                                                    <span class="help">发货后多少天系统自动确认收货 单位为天</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group row">
                                            <div class="col-md-6">
                                                <label>减库存的时机</label>
                                                <div class="clearfix">
                                                    <label class="lyear-radio radio-inline radio-theme">
                                                        <input type="radio" name="reduce" value="1" {if $config.reduce==1}checked{/if}><span>下单成功时</span>
                                                    </label>
                                                    <label class="lyear-radio radio-inline radio-theme">
                                                        <input type="radio" name="reduce" value="2" {if $config.reduce==2}checked{/if}><span>支付成功时</span>
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group m-t-10 m-b-10">
                                            <input type="hidden" name="inc_type" value="{$inc_type}">
                                            <button type="button" class="btn-theme submit-btn">确定</button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
        <!--End 页面主要内容-->
    </div>
</div>

<script type="text/javascript">
    $(function () {
        $('.submit-btn').on('click',function () {
            var url = "{:url('System/handle')}";
            var data = $('.edit-form').serialize();
            public_ajax(url,data,function (res) {
                if (res.code == 1) {
                    showSuccessMsg(res.msg);
                } else {
                    showErrorMsg(res.msg);
                }
            })
        })
    });
    function call_back(fileurl_tmp,fileurl_id)
    {
        $("[name="+fileurl_id+"]").val(fileurl_tmp);
        $("#"+fileurl_id).attr('src', fileurl_tmp);
    }
</script>
</body>
</html>
